package com.fingard.dsp.bank.directbank.abc02.receiptpro;

import java.io.File;
import java.util.Date;

import com.fingard.constant.Format;
import com.fingard.dsp.bank.directConfig.ReceiptProConfig;
import com.fingard.dsp.bank.directbank.abc02.ABC02ReceiptPro;
import com.fingard.dsp.bank.helpers.receipthelpers.DownReceiptFileHelper;
import com.fingard.dsp.bank.reqrespobj.downloadreceipt.ReqQryReceipt;
import com.fingard.dsp.bank.reqrespobj.downloadreceipt.RetAtsReceipt;
import com.fingard.dsp.bank.sepro.ReceiptPro;
import com.fingard.io.FileHelper;

/**ftp/sftp方式下载回单文件*/
public class ABC02ReceiptProFtp extends ABC02ReceiptPro{
	
	public RetAtsReceipt qryReceiptOneDay(ReceiptProConfig pConfig, ReqQryReceipt pReqReceipt, Date pOneDay) throws Exception {
	
		String qryDay8 = Format.Date8Format.format(pOneDay);
		String saveDirPathTemp = pConfig.getSaveSubDir(pReqReceipt.reqHeader, pOneDay) + File.separator + qryDay8 + File.separator + ReceiptPro.getTransID();
		String chkDay = "_"+qryDay8+"_";
		//调用通用下载方法
		DownReceiptFileHelper downFileHelper = new DownReceiptFileHelper(this);
		downFileHelper.downAndUnZipFiles(saveDirPathTemp, chkDay);
		
		//调用提取pdf文件方法
		getPdfFiles(pConfig, pReqReceipt, pOneDay, saveDirPathTemp);
		
		WriteBankLogLn("删除"+saveDirPathTemp);
        FileHelper.deleteRecursive(saveDirPathTemp);
		
		return null;
	}

}
